# the minimum version of CMake.
cmake_minimum_required(VERSION 3.4.1)

project(entry)

list(APPEND CMAKE_FIND_ROOT_PATH ${QT_PREFIX})

#1使用自动化脚本执行（run_unittests.py），0不使用
set(EXE_BY_SCRIPTE 1)

set(ISSQTTESTROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../../../../../..)

if(EXE_BY_SCRIPTE)

add_library(entry SHARED main.cpp)

message(ISSQTTESTROOTDIR=${ISSQTTESTROOTDIR})

# QtSerialBus
option(TST_QTSERIALBUS_AUTO "Enable QTSERIALBUS_AUTO Test" OFF)

# QtSerialPort
option(TST_QTSERIALPORT_AUTO "Enable QTSERIALPORT_AUTO Test" OFF)

# Qt3D
option(TST_QT3D_AUTO_ANIMATION "Enable QT3D_AUTO_ANIMATION Test" OFF)
option(TST_QT3D_AUTO_CORE "Enable QT3D_AUTO_CORE Test" OFF)
option(TST_QT3D_AUTO_EXTRAS "Enable QT3D_AUTO_EXTRAS Test" OFF)
option(TST_QT3D_AUTO_GEOMETRYLOADERS "Enable QT3D_AUTO_GEOMETRYLOADERS Test" OFF)
option(TST_QT3D_AUTO_INPUT "Enable QT3D_AUTO_INPUT Test" OFF)
option(TST_QT3D_AUTO_QUICK3D "Enable QT3D_AUTO_QUICK3D Test" OFF)
option(TST_QT3D_AUTO_RENDER "Enable QT3D_AUTO_RENDER Test" OFF)
option(TST_QT3D_BENCHMARKS_CORE "Enable QT3D_BENCHMARKS_CORE Test" OFF)
option(TST_QT3D_BENCHMARKS_RENDER "Enable QT3D_BENCHMARKS_RENDER Test" OFF)

# QtRemoteObjects
option(TST_QTREMOTEOBJECTS_AUTO_BENCHMARKS "Enable QTREMOTEOBJECTS_AUTO_BENCHMARKS Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_INTEGRATION "Enable QTREMOTEOBJECTS_AUTO_INTEGRATION Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_MODELREPLICA "Enable QTREMOTEOBJECTS_AUTO_MODELREPLICA Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_MODELVIEW "Enable QTREMOTEOBJECTS_AUTO_MODELVIEW Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_PODS "Enable QTREMOTEOBJECTS_AUTO_PODS Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_PROXY "Enable QTREMOTEOBJECTS_AUTO_PROXY Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_PROXY_MULTIPROCESS "Enable QTREMOTEOBJECTS_AUTO_PROXY_MULTIPROCESS Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_QML "Enable QTREMOTEOBJECTS_AUTO_QML Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_REPC "Enable QTREMOTEOBJECTS_AUTO_REPC Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_REPCODEGENERATOR "Enable QTREMOTEOBJECTS_AUTO_REPCODEGENERATOR Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_REPPARSER "Enable QTREMOTEOBJECTS_AUTO_REPPARSER Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_RESTART "Enable QTREMOTEOBJECTS_AUTO_RESTART Test" OFF)
option(TST_QTREMOTEOBJECTS_AUTO_SUBCLASSREPLICA "Enable QTREMOTEOBJECTS_AUTO_SUBCLASSREPLICA Test" OFF)

# QtCharts
option(TST_QTCHARTS_AUTO "Enable QTCHARTS_AUTO Test" OFF)

# QtConnectivity
option(TST_QTCONNECTIVITY_AUTO "Enable QTCONNECTIVITY_AUTO Test" OFF)

# QtImageFormats
option(TST_QTIMAGEFORMATS_AUTO "Enable QTIMAGEFORMATS_AUTO Test" OFF)

# QtMultimedia
option(TST_QTMMULTIMEDIA_AUTO_INTEGRATION "Enable QTMMULTIMEDIA_AUTO_INTEGRATION Test" OFF)
option(TST_QTMMULTIMEDIA_AUTO_UNIT_MULTIMEDIA "Enable QTMMULTIMEDIA_AUTO_UNIT_MULTIMEDIA Test" OFF)

# QtSensors
option(TST_QTSSENSORS_AUTO "Enable QTSSENSORS_AUTO Test" OFF)

# QtSVG
option(TST_QTSVG_AUTO "Enable QTSVG_AUTO Test" OFF)

# QtBase
option(TST_QTBASE_AUTO_CORELIB  "Enable QTBASE_AUTO_CORELIB Test" OFF)
option(TST_QTBASE_AUTO_GUI  "Enable QTBASE_AUTO_GUI Test" OFF)
option(TST_QTBASE_AUTO_INTEGRATION_GUI  "Enable QTBASE_AUTO_INTEGRATION_GUI Test" OFF)
option(TST_QTBASE_AUTO_INTEGRATION_NONE  "Enable QTBASE_AUTO_INTEGRATION_NONE Test" OFF)
option(TST_QTBASE_AUTO_NETWORK  "Enable QTBASE_AUTO_NETWORK Test" OFF)
option(TST_QTBASE_AUTO_OTHER  "Enable QTBASE_AUTO_OTHER Test" OFF)
option(TST_QTBASE_AUTO_RESIDUE  "Enable QTBASE_AUTO_RESIDUE Test" OFF)
option(TST_QTBASE_AUTO_TESTLIB  "Enable QTBASE_AUTO_TESTLIB Test" OFF)
option(TST_QTBASE_AUTO_WIDGETS  "Enable QTBASE_AUTO_WIDGETS Test" OFF)
option(TST_QTBASE_BENCHMARKS  "Enable QTBASE_BENCHMARKS Test" OFF)

# QtGraphicalEffects
option(TST_QTGRAPHICALEFFECTS_AUTO  "Enable QTGRAPHICALEFFECTS_AUTO Test" OFF)

# QtDeclarative
option(TST_QTDECLARATIVE_AUTO  "Enable QTDECLARATIVE_AUTO Test" OFF)
option(TST_QTDECLARATIVE_BENCHMARKS  "Enable QTDECLARATIVE_BENCHMARKS Test" OFF)

# QtDatavis3D
option(TST_QTDATAVIS3D_AUTO  "Enable QTDATAVIS3D_AUTO Test" OFF)
option(TST_QTDATAVIS3D_AUTO2  "Enable QTDATAVIS3D_AUTO2 Test" OFF)
option(TST_QTDATAVIS3D_AUTO3  "Enable QTDATAVIS3D_AUTO3 Test" OFF)
option(TST_QTDATAVIS3D_AUTO4  "Enable QTDATAVIS3D_AUTO4 Test" OFF)

# QtQuickControls2
option(TST_QTQuickControls2_AUTO  "Enable QuickControls2_AUTO Test" OFF)
option(TST_QTQuickControls2_BENCHMARKS  "Enable QuickControls2_BENCHMARKS Test" OFF)
option(TST_QTQuickControls2_QQUICKICONIMAGE  "Enable QuickControls2_QQUICKICONIMAG Test" OFF)

# QtLocation
option(TST_QTLocation_AUTO  "Enable QtLocation_AUTO Test" OFF)
option(TST_QTLocation_AUTO2  "Enable QtLocation_AUTO2 Test" OFF)




if(TST_QTSERIALBUS_AUTO)
    add_subdirectory(qtserialbus_auto)
    target_link_libraries(entry PRIVATE tst_qtserialbus_auto)
elseif(TST_QTSERIALPORT_AUTO)
    add_subdirectory(qtserialport_auto)
    target_link_libraries(entry PRIVATE tst_qtserialport_auto)
elseif(TST_QT3D_AUTO_ANIMATION)
    add_subdirectory(qt3d_auto_animation)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_animation)
elseif(TST_QT3D_AUTO_CORE)
    add_subdirectory(qt3d_auto_core)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_core)
elseif(TST_QT3D_AUTO_EXTRAS)
    add_subdirectory(qt3d_auto_extras)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_extras)
elseif(TST_QT3D_AUTO_GEOMETRYLOADERS)
    add_subdirectory(qt3d_auto_geometryloaders)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_geometryloaders)
elseif(TST_QT3D_AUTO_INPUT)
    add_subdirectory(qt3d_auto_input)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_input)
elseif(TST_QT3D_AUTO_QUICK3D)
    add_subdirectory(qt3d_auto_quick3d)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_quick3d)
elseif(TST_QT3D_AUTO_RENDER)
    add_subdirectory(qt3d_auto_render)
    target_link_libraries(entry PRIVATE tst_qt3d_auto_render)
elseif(TST_QT3D_BENCHMARKS_CORE)
    add_subdirectory(qt3d_benchmarks_core)
    target_link_libraries(entry PRIVATE tst_qt3d_benchmarks_core)
elseif(TST_QT3D_BENCHMARKS_RENDER)
    add_subdirectory(qt3d_benchmarks_render)
    target_link_libraries(entry PRIVATE tst_qt3d_benchmarks_render)

elseif(TST_QTREMOTEOBJECTS_AUTO_BENCHMARKS)
    add_subdirectory(qtremoteobjects_auto_benchmarks)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_benchmarks)
elseif(TST_QTREMOTEOBJECTS_AUTO_INTEGRATION)
    add_subdirectory(qtremoteobjects_auto_integration)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_integration)
elseif(TST_QTREMOTEOBJECTS_AUTO_MODELREPLICA)
    add_subdirectory(qtremoteobjects_auto_modelreplica)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_modelreplica)
elseif(TST_QTREMOTEOBJECTS_AUTO_MODELVIEW)
    add_subdirectory(qtremoteobjects_auto_modelview)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_modelview)
elseif(TST_QTREMOTEOBJECTS_AUTO_PODS)
    add_subdirectory(qtremoteobjects_auto_pods)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_pods)
elseif(TST_QTREMOTEOBJECTS_AUTO_PROXY)
    add_subdirectory(qtremoteobjects_auto_proxy)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_proxy)
elseif(TST_QTREMOTEOBJECTS_AUTO_PROXY_MULTIPROCESS)
    add_subdirectory(qtremoteobjects_auto_proxy_multiprocess)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_proxy_multiprocess)
elseif(TST_QTREMOTEOBJECTS_AUTO_QML)
    add_subdirectory(qtremoteobjects_auto_qml)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_qml)
elseif(TST_QTREMOTEOBJECTS_AUTO_REPC)
    add_subdirectory(qtremoteobjects_auto_repc)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_repc)
elseif(TST_QTREMOTEOBJECTS_AUTO_REPCODEGENERATOR)
    add_subdirectory(qtremoteobjects_auto_repcodegenerator)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_repcodegenerator)
elseif(TST_QTREMOTEOBJECTS_AUTO_REPPARSER)
    add_subdirectory(qtremoteobjects_auto_repparser)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_repparser)
elseif(TST_QTREMOTEOBJECTS_AUTO_RESTART)
    add_subdirectory(qtremoteobjects_auto_repparser)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_repparser)
elseif(TST_QTREMOTEOBJECTS_AUTO_SUBCLASSREPLICA)
    add_subdirectory(qtremoteobjects_auto_subclassreplica)
    target_link_libraries(entry PRIVATE tst_qtremoteobjects_auto_subclassreplica)

elseif(TST_QTCHARTS_AUTO)
    add_subdirectory(qtcharts_auto)
    target_link_libraries(entry PRIVATE tst_qtcharts_auto)

elseif(TST_QTCONNECTIVITY_AUTO)
    add_subdirectory(qtconnectivity_auto)
    target_link_libraries(entry PRIVATE tst_qtconnectivity_auto)

elseif(TST_QTIMAGEFORMATS_AUTO)
    add_subdirectory(qtimageformats_auto)
    target_link_libraries(entry PRIVATE tst_qtimageformats_auto)

elseif(TST_QTMMULTIMEDIA_AUTO_INTEGRATION)
    add_subdirectory(qtmultimedia_auto_integration)
    target_link_libraries(entry PRIVATE tst_qtmultimedia_auto_integration)
elseif(TST_QTMMULTIMEDIA_AUTO_UNIT_MULTIMEDIA)
    add_subdirectory(qtmultimedia_auto_unit_multimedia)
    target_link_libraries(entry PRIVATE tst_qtmultimedia_auto_unit_multimedia)

elseif(TST_QTSSENSORS_AUTO)
    add_subdirectory(qtsensors_auto)
    target_link_libraries(entry PRIVATE tst_qtsensors_auto)

elseif(TST_QTSVG_AUTO)
    add_subdirectory(qtsvg_auto)
    target_link_libraries(entry PRIVATE tst_qtsvg_auto)

elseif(TST_QTBASE_AUTO_CORELIB)
    add_subdirectory(qtbase_auto_corelib)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_corelib)
elseif(TST_QTBASE_AUTO_GUI)
    add_subdirectory(qtbase_auto_gui)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_gui)
elseif(TST_QTBASE_AUTO_INTEGRATION_GUI)
    add_subdirectory(qtbase_auto_integration_gui)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_integration_gui)
elseif(TST_QTBASE_AUTO_INTEGRATION_NONE)
    add_subdirectory(qtbase_auto_integration_none)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_integration_none)
elseif(TST_QTBASE_AUTO_NETWORK)
    add_subdirectory(qtbase_auto_network)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_network)
elseif(TST_QTBASE_AUTO_OTHER)
    add_subdirectory(qtbase_auto_other)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_other)
elseif(TST_QTBASE_AUTO_RESIDUE)
    add_subdirectory(qtbase_auto_residue)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_residue)
elseif(TST_QTBASE_AUTO_TESTLIB)
    add_subdirectory(qtbase_auto_testlib)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_testlib)
elseif(TST_QTBASE_AUTO_WIDGETS)
    add_subdirectory(qtbase_auto_widgets)
    target_link_libraries(entry PRIVATE tst_qtbase_auto_widgets)
elseif(TST_QTBASE_BENCHMARKS)
    add_subdirectory(qtbase_benchmarks)
    target_link_libraries(entry PRIVATE tst_qtbase_benchmarks)

elseif(TST_QTGRAPHICALEFFECTS_AUTO)
    add_subdirectory(qtgraphicaleffects_auto)
    target_link_libraries(entry PRIVATE tst_qtgraphicaleffects_auto)

elseif(TST_QTDECLARATIVE_AUTO)
    add_subdirectory(qtdeclarative_auto)
    target_link_libraries(entry PRIVATE tst_qtdeclarative_auto)
elseif(TST_QTDECLARATIVE_BENCHMARKS)
    add_subdirectory(qtdeclarative_benchmarks)
    target_link_libraries(entry PRIVATE tst_qtdeclarative_benchmarks)

elseif(TST_QTDATAVIS3D_AUTO)
    add_subdirectory(qtdatavis3d_auto)
    target_link_libraries(entry PRIVATE tst_qtdatavis3d_auto)
elseif(TST_QTDATAVIS3D_AUTO2)
    add_subdirectory(qtdatavis3d_auto2)
    target_link_libraries(entry PRIVATE tst_qtdatavis3d_auto2)
elseif(TST_QTDATAVIS3D_AUTO3)
    add_subdirectory(qtdatavis3d_auto3)
    target_link_libraries(entry PRIVATE tst_qtdatavis3d_auto3)
elseif(TST_QTDATAVIS3D_AUTO4)
    add_subdirectory(qtdatavis3d_auto4)
    target_link_libraries(entry PRIVATE tst_qtdatavis3d_auto4)

elseif(TST_QTQuickControls2_AUTO)
    add_subdirectory(qtquickcontrols2_auto)
    target_link_libraries(entry PRIVATE tst_qtquickcontrols2_auto)
elseif(TST_QTQuickControls2_BENCHMARKS)
    add_subdirectory(qtquickcontrols2_benchmarks)
    target_link_libraries(entry PRIVATE tst_qtquickcontrols2_benchmarks)
elseif(TST_QTQuickControls2_QQUICKICONIMAGE)
    add_subdirectory(qtquickcontrols2_qquickiconimage)
    target_link_libraries(entry PRIVATE tst_qtquickcontrols2_qquickiconimage)

elseif(TST_QTLocation_AUTO)
    add_subdirectory(qtlocation_auto)
    target_link_libraries(entry PRIVATE tst_qtlocation_auto)
elseif(TST_QTLocation_AUTO2)
    add_subdirectory(qtlocation_auto2)
    target_link_libraries(entry PRIVATE tst_qtlocation_auto2)
endif()

else()

#add_subdirectory(qt3d_auto_animation)
#add_subdirectory(qt3d_auto_core)
#add_subdirectory(qt3d_benchmarks_core)
##add_subdirectory(qt3d_auto_extras)                                         #only private test
##add_subdirectory(qt3d_auto_geometryloaders)                                #only private test
##add_subdirectory(qt3d_auto_input)                                          #only private test
##add_subdirectory(qt3d_auto_quick3d)                                        #only private test
##add_subdirectory(qt3d_auto_render)                                         #only private test
##add_subdirectory(qt3d_benchmarks_render)                                   #only private test
#add_subdirectory(qtremoteobjects_auto_benchmarks)
#add_subdirectory(qtremoteobjects_auto_integration)
#add_subdirectory(qtremoteobjects_auto_modelreplica)
#add_subdirectory(qtremoteobjects_auto_modelview)
#add_subdirectory(qtremoteobjects_auto_pods)
#add_subdirectory(qtremoteobjects_auto_proxy)
##add_subdirectory(qtremoteobjects_auto_proxy_multiprocess)                   #多进程鸿蒙暂不支持
#add_subdirectory(qtremoteobjects_auto_qml)
#add_subdirectory(qtremoteobjects_auto_repc)
#add_subdirectory(qtremoteobjects_auto_repcodegenerator)
##add_subdirectory(qtremoteobjects_auto_repparser)                             #private test
##add_subdirectory(qtremoteobjects_auto_restart)                               #多进程鸿蒙暂不支持
#add_subdirectory(qtremoteobjects_auto_subclassreplica)
#add_subdirectory(qtbase_auto_corelib)
#add_subdirectory(qtbase_auto_gui)
#add_subdirectory(qtbase_auto_integration_gui)
#add_subdirectory(qtbase_auto_integration_none)
#add_subdirectory(qtbase_auto_network)
#add_subdirectory(qtbase_auto_other)
#add_subdirectory(qtbase_auto_residue)
#add_subdirectory(qtbase_auto_testlib)
#add_subdirectory(qtbase_auto_widgets)
#add_subdirectory(qtbase_benchmarks)
#add_subdirectory(qtcharts_auto)
#add_subdirectory(qtconnectivity_auto)
#add_subdirectory(qtdatavis3d_auto)
#add_subdirectory(qtdatavis3d_auto2)
#add_subdirectory(qtdatavis3d_auto3)
#add_subdirectory(qtdatavis3d_auto4)
#add_subdirectory(qtdeclarative_auto)
#add_subdirectory(qtdeclarative_benchmarks)
#add_subdirectory(qtgraphicaleffects_auto)
#add_subdirectory(qtimageformats_auto)
#add_subdirectory(qtlocation_auto)
#add_subdirectory(qtlocation_auto2)
#add_subdirectory(qtmultimedia_auto_integration)
#add_subdirectory(qtmultimedia_auto_unit_multimedia)
#add_subdirectory(qtquickcontrols2_auto)
#add_subdirectory(qtquickcontrols2_benchmarks)
#add_subdirectory(qtquickcontrols2_qquickiconimage)
#add_subdirectory(qtsensors_auto)
#add_subdirectory(qtserialbus_auto)
#add_subdirectory(qtserialport_auto)
#add_subdirectory(qtsvg_auto)


endif()